/** Class Name: OORTelesalesUpdateLeadOwnerTest 
 * Author: Accenture
 * Date: 3-March-2012
 * Requirement/Project Name: OOR Telesales
 * Requirement Description:  Test class for OORTelesalesUpdateLeadOwner
 **/
 
@istest(seealldata=true)
private class OORTelesalesUpdateLeadOwnerTest 
{
    
    
    /**
     *  Test method 
     */  
    static testMethod void testupdateOwner() 
    {
      ID localAdvertiserRecordTypeID = RecordTypeHelper.GetRecordTypeIdByDevName('Lead', OORTelesalesTextConstant.LOCAL_ADVERTISER_LEAD_REC_TYPE);   
     // QueueSobject OORLeadCampaignQueue= [Select QueueId from QueueSobject q where sobjecttype ='Lead'  and queue.name= :OORTelesalesTextConstant.OOR_TELE_CAMPAIGN_LEAD_QUEUE ];                   
      Lead  le  = new Lead(FirstName='testFirstname',LastName = 'ash', company='ABc',Lead_Status_ReadOnly__c = 'New' ,Status='New',RecordTypeId=localAdvertiserRecordTypeID );
      insert le;
      
      Campaign camp = new Campaign(Name='abx',IsActive=True,StartDate=Date.Today());
      insert camp;
      
      CampaignMember  campMemb  = new CampaignMember();
      campMemb.CampaignId =camp.id;
      campMemb.LeadID =le.id;
      insert campMemb  ;
      le.ownerId=OORTelesalesUtility.getQueueID(OORTelesalesTextConstant.OOR_TELE_CAMPAIGN_LEAD_QUEUE);   
      Update le;
            
      OORTelesalesUpdateLeadOwner.updateOwner(camp.id);
      
    }
}